<div>
    <el-form label-width="100%">
        <el-form-item label="">
        </el-form-item>
    </el-form>
    <el-form :inline="true" :model="orderFormInline" ref="orderFormInline">

        <el-row>
            <el-col :span="6">
            <el-form-item label="项目名称" label-width="80px">
                <el-input v-model="orderFormInline.projectName" placeholder="项目名称" style="width: 150px" :disabled="isShow"></el-input>
            </el-form-item>
            </el-col>
            <el-col :span="6">
        <el-form-item label="采购日期"  required label-width="80px">
            <el-date-picker
                    v-model="orderFormInline.purchaseDate"
                    align="right"
                    type="date"
                    placeholder="选择日期"
                    :picker-options="pickerOptions1" style="width: 150px" :disabled="isShow">
            </el-date-picker>
        </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="供货商"  prop="supplier" label-width="80px" >
                    <el-select v-model="orderFormInline.supplier" style="width: 150px;" placeholder="请选择供货商" :disabled="isShow">
                        <el-option
                                v-for="item in suppliers"
                                :key="item.supplierId"
                                :value="item.supplierAbbr">
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
                <el-col :span="6">
                <el-form-item label="联系人" label-width="80px">
                    <el-input v-model="orderFormInline.contacts" placeholder="联系人" style="width: 150px" :disabled="isShow"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="联系电话" label-width="80px">
                    <el-input v-model="orderFormInline.phone" placeholder="联系电话" style="width: 150px" :disabled="isShow"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                <el-form-item label="交互地址" label-width="80px">
                    <el-input v-model="orderFormInline.interactiveAddress" placeholder="交互地址" style="width: 150px" :disabled="isShow"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="14">
                <el-form-item label="交互日期"  required label-width="80px">
                    <el-date-picker
                            v-model="orderFormInline.interactiveDate"
                            align="right"
                            type="date"
                            placeholder="选择日期"
                            :picker-options="pickerOptions2" style="width: 150px" :disabled="isShow">
                    </el-date-picker>
                </el-form-item>
            </el-col>
            <el-col :span="4">
                <el-form-item label=""  class = "transparent">
                    <el-button type="primary" v-show="isEditOrAdd" @click="addNeedGoods">添加需求商品</el-button>
                </el-form-item>
            </el-col>

        </el-row>

  <el-table
            :data="orderFormInline.buyGoodsPos"
            border
            style="width: 100%">
        <el-table-column
                prop="goodsCode"
                label="商品编码"
              >
        </el-table-column>
        <el-table-column
                prop="goodsName"
                label="商品名称"
              >
        </el-table-column>
        <el-table-column
                prop="goodsSpec"
                label="规格型号">
        </el-table-column>
      <el-table-column
              prop="unit"
              label="单位">
      </el-table-column>
      <el-table-column
              prop="needNum"
              label="采购数量">
      </el-table-column>
      <el-table-column
              prop="budgetPrice"
              label="单价">
      </el-table-column>
      <el-table-column
              prop="budgetMoney"
              label="金额">
      </el-table-column>

    <el-table-column
            label="操作"
            width="100" v-if="isEditOrAdd">
        <template scope="scope">
            <el-button   @click="editNeedGoods(scope)" type="text" size="small">修改</el-button>
            <el-button   @click="deleteNeedGoods(scope)"type="text" size="small">删除</el-button>
        </template>
    </el-table-column>
  </el-table>
<h4 style="color: #990000;float:right">
  总金额：  {{totalMoney}}  元
</h4>
        <el-form-item>
        </el-form-item>
        <el-row>
            <el-col :span="10">
                <el-form-item></el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item>
                  <el-button v-show="isEditOrAdd" @click="saveOrder"type="success" size="large" >保存</el-button>
                  <el-button v-show="isShow" @click="closeOrder"type="success" size="large" >关闭</el-button>
                  <el-button v-show="isEditOrAdd" @click="clearOrder"type="success" size="large">取消</el-button>
              </el-form-item>
            </el-col>
        </el-row>

    </el-form>

    <!--模态框：添加需求商品-->
    <el-dialog :visible.sync="dialogFormVisible" size="tiny" top="8%">
        <el-form :inline="true" :model="addNeedGoodsFormInline"  ref="addNeedGoodsFormInline" class="addNeedGoods-form-inline">
            <el-form-item label="采购计划编号" label-width="120px">
                <el-select v-model="addNeedGoodsFormInline.purchasePlanNo" placeholder="请选择" @change="purchasePlanChange">
                    <el-option
                            v-for="item in purchasePlans1"
                            :key="item.purchasePlanId"
                            :label="item.purchasePlanNo"
                            :value="item.purchasePlanNo">
                    </el-option>
                </el-select>
            </el-form-item>
                <el-form-item label="商品编码"  prop="goodsCode" label-width="120px">
                    <el-input
                            placeholder="请输入内容"
                            v-model="addNeedGoodsFormInline.goodsCode"
                            :disabled="true">
                    </el-input>
                </el-form-item>
                <el-form-item label="商品名称"  prop="goodsName" label-width="120px">
                    <el-input
                            placeholder="请输入内容"
                            v-model="addNeedGoodsFormInline.goodsName"
                            :disabled="true">
                    </el-input>
                </el-form-item>
                <el-form-item label="规格型号"  prop="goodsSpec" label-width="120px">
                    <el-input
                            placeholder="请输入内容"
                            v-model="addNeedGoodsFormInline.goodsSpec"
                            :disabled="true">
                    </el-input>
                </el-form-item>
                <el-form-item label="采购数量" prop="purchaseNum" label-width="120px">
                    <el-input v-model="addNeedGoodsFormInline.needNum" placeholder="采购数量"></el-input>
                </el-form-item>
                <el-form-item label="单位" prop="unit" label-width="120px">
                    <el-input v-model="addNeedGoodsFormInline.unit" placeholder="单位"></el-input>
                </el-form-item>
                <el-form-item label="实际单价" prop="purchasePrice" label-width="120px">
                    <el-input v-model="addNeedGoodsFormInline.budgetPrice" placeholder="实际单价"></el-input>
                </el-form-item>
                <el-form-item label="金额" prop="purchaseMoney" label-width="120px">
                    <el-input v-model="addNeedGoodsFormInline.budgetMoney" placeholder="金额"></el-input>
                </el-form-item>
        </el-form>
        <el-form>
            <el-row>
                <el-col :span="16">
                    <el-form-item>

                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item>
                        <el-button  @click="clear()">取 消</el-button>
                        <el-button type="primary" @click="addGoods()">确定</el-button>
                    </el-form-item>
                </el-col>
            </el-row>

        </el-form>
    </el-dialog>



</div>